package com.cy.utils;

import javax.servlet.http.HttpServletRequest;

/**
 * 判断是否为手机
 * @author CY
 *
 */
public class IsMoblie {

	public static boolean isMoblie(HttpServletRequest request) {
		String userAgent = request.getHeader("User-Agent");
		System.out.println(userAgent);
		if(userAgent.contains("Android") || userAgent.contains("iPhone") || userAgent.contains("iPod") || userAgent.contains("Windows Phone")) {
			System.out.println("手机");
			return true;
		} else {
			System.out.println("PC");
			return false;
		}
	}
	
}
